// 视图组件
const view = {
    tabs: () => import('@/layouts/tabs'),
    blank: () => import('@/layouts/BlankView'),
    page: () => import('@/layouts/PageView')
}

// 路由组件注册
const routerMap = {
    root: {
        path: '/',
        redirect: '/login',
        component: view.tabs
    },
    exp403: {
        authority: '*',
        name: 'exp403',
        path: '403',
        component: () => import('@/pages/exception/403')
    },
    exp404: {
        name: 'exp404',
        path: '404',
        component: () => import('@/pages/exception/404')
    },
    exp500: {
        name: 'exp500',
        path: '500',
        component: () => import('@/pages/exception/500')
    },
    login: {
        authority: '*',
        path: '/login',
        component: () => import('@/pages/login')
    },
    index: {
        name: '首页',
        renderMenu: false,
        component: () => import('@/pages/index')
    },
    settings: {
        name: '系统设置',
        icon: 'dashboard',
        component: view.blank
    },
    product: {
        name: '商品管理',
        icon: 'dashboard',
        component: view.page
    },
    supply: {
        name: '商家管理',
        icon: 'dashboard',
        component: view.page
    },
    drugstore: {
        name: '药店管理',
        icon: 'form',
        component: view.page
    },
    order: {
        name: '订单管理',
        icon: 'form',
        component: view.page
    },
    product_brand: {
        name: '品牌管理',
        path: 'brand',
        icon: 'warning',
        component: () => import('@/pages/exception/403')
    },
    settings_params: {
        name: '参数设置',
        path: 'params',
        icon: 'warning',
        component: () => import('@/pages/exception/403')
    },
    settings_dictionary: {
        name: '字典管理',
        path: 'dictionary',
        icon: 'warning',
        component: () => import('@/pages/exception/500')
    },
    product_type: {
        name: '类型管理',
        path: 'type',
        icon: 'warning',
        component: () => import('@/pages/exception/500')
    },
    settings_resource: {
        name: '资源列表',
        path: 'resource',
        icon: 'warning',
        component: () => import('@/pages/resource/ResourceList.vue')
    },
    settings_permission: {
        name: '权限列表',
        path: 'permission',
        icon: 'warning',
        component: () => import('@/pages/permission/PermissionList.vue')
    },
    settings_role: {
        name: '角色列表',
        path: 'role',
        icon: 'warning',
        component: () => import('@/pages/role/RoleList.vue')
    }
}
export default routerMap
